package com.itheima.search.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * 新闻状态枚举
 */
@Getter
public enum NewsStatus {
    NORMAL(0L, "正常"),
    DELAY_PUBLISH(1L, "延迟发布"),
    PUBLISH(2L, "发布"),
    DELETED(3L, "删除");

    private Long status;
    //标记JSON序列化时展示的字段
    @JsonValue
    private String description;

    // 构造函数
    NewsStatus(Long status, String description) {
        this.status = status;
        this.description = description;
    }
}